package com.example.sbbsec.quartz.entity.schedule.cron;

import com.example.sbbsec.quartz.entity.schedule.ScheduleJob;
import com.example.sbbsec.quartz.executor.AbstractJobExecutor;
import com.google.common.base.MoreObjects;


/**
 * cron 任务
 *
 * @author lowe.yang
 * @date 2019-01-04 10:37
 */
public class CronJob extends ScheduleJob {
    public CronJob() {
        super();
    }

    public CronJob(String jobName) {
        super(jobName);
    }

    public CronJob(String jobName, Class<? extends AbstractJobExecutor> target) {
        super(jobName, target);
    }

    public CronJob(String jobName, Class<? extends AbstractJobExecutor> executor, String cronExpression) {
        super(jobName, executor);
        this.cronExpression = cronExpression;
    }


    //执行表达式
    private String cronExpression;

    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(super.toString())
                .add("cronExpression", cronExpression)
                .toString();
    }
}
